Optimal. Leaf size=61 \[ \frac{(a-b)^2 \log (\sin (c+d x)+1)}{2 d}-\frac{(a+b)^2 \log (1-\sin (c+d x))}{2 d}-\frac{b^2 \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0818299, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {2668, 702, 633, 31} \[ \frac{(a-b)^2 \log (\sin (c+d x)+1)}{2 d}-\frac{(a+b)^2 \log (1-\sin (c+d x))}{2 d}-\frac{b^2 \sin (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2668
Rule 702
Rule 633
Rule 31
Rubi steps
\begin{align*} \int \sec (c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac{b \operatorname{Subst}\left (\int \frac{(a+x)^2}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac{b \operatorname{Subst}\left (\int \left (-1+\frac{a^2+b^2+2 a x}{b^2-x^2}\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac{b^2 \sin (c+d x)}{d}+\frac{b \operatorname{Subst}\left (\int \frac{a^2+b^2+2 a x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac{b^2 \sin (c+d x)}{d}-\frac{(a-b)^2 \operatorname{Subst}\left (\int \frac{1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}+\frac{(a+b)^2 \operatorname{Subst}\left (\int \frac{1}{b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=-\frac{(a+b)^2 \log (1-\sin (c+d x))}{2 d}+\frac{(a-b)^2 \log (1+\sin (c+d x))}{2 d}-\frac{b^2 \sin (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.0625328, size = 54, normalized size = 0.89 \[ \frac{(a-b)^2 \log (\sin (c+d x)+1)-(a+b)^2 \log (1-\sin (c+d x))-2 b^2 \sin (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.043, size = 72, normalized size = 1.2 \begin{align*}{\frac{{a}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}-{\frac{{b}^{2}\sin \left ( dx+c \right ) }{d}}-2\,{\frac{ab\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.962998, size = 81, normalized size = 1.33 \begin{align*} -\frac{2 \, b^{2} \sin \left (d x + c\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) +{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.27886, size = 159, normalized size = 2.61 \begin{align*} -\frac{2 \, b^{2} \sin \left (d x + c\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) +{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (c + d x \right )}\right )^{2} \sec{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12927, size = 84, normalized size = 1.38 \begin{align*} -\frac{2 \, b^{2} \sin \left (d x + c\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) +{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]